<?php
	include(ROOTPATH .'include'. DS .'protect.php');
	include(ROOTPATH .'include'. DS .'checkUserLogin.php');
	$powder_min = 5 ;
	include(ROOTPATH .'include'. DS .'checkPowder.php');
	
	include(ROOTPATH .'class'. DS .'task.class.php');
	$page 				= getPage('page');
	$idCode				= getQuery('id');
	$id					= getId('id');
	
	$task = new task();
	
	$sql = 'SELECT * FROM `'. DB_PRE.'task` WHERE `id` = '. $id;	
	$show = $dbs -> select($sql);
	$show = $show[0];
	
	
	
	
	
	if( $show['user_id'] != $user -> id() && $user -> powder() < 9 )
		header('Location:'.urlRewrite('option=home&id='. $user -> id()));
 
	$task -> checkOwner($show['user_id']);
	
	$sql = 'SELECT * FROM `'. DB_PRE.'task_attend` WHERE `task_id` = '. $id;	
	$lists = $dbs -> select($sql);
	
	$isTimeout = false;
	if( $task -> isTimeout($show['timeEnd']))
		$isTimeout = true;

	//$showUser = new users();
	//$userInfo = $showUser -> getUser($show['user_id']);


?>